﻿@model Dexter.Web.Mvc.ViewModel.Backoffice.ViewsData.SetupController.WizardViewData

@section header
{
<link href="@Url.Content( "~/Admin/Resources/Styles/wizard.css" )" rel="stylesheet" type="text/css" />
}
<!-- the 'special-page' class is only an identifier for scripts -->
<body class="special-page wizard-bg">
<!-- The template uses conditional comments to add wrappers div for ie8 and ie7 - just add .ie, .ie7 or .ie6 prefix to your css selectors when needed -->
<!--[if lt IE 9]><div class="ie"><![endif]-->
<!--[if lt IE 8]><div class="ie7"><![endif]-->
	
<section>
	<div class="block-border">
		<form class="block-content form inline-medium-label" name="login-form" id="login-form" method="post">
			@Html.AntiForgeryToken()
				
			<h1>Dexter Setup</h1>
			
			<ol class="wizard-steps no-margin">
				<li class="disabled">
					<a href="#">
						<span class="number">1</span>
						User
					</a>
				</li>
				<li class="disabled">
					<a href="#">
						<span class="number">2</span>
						Setting
					</a>
				</li>
				<li class="disabled">
					<a href="#">
						<span class="number">3</span>
						Database
					</a>
				</li>
			</ol>

			@if (!ViewData.ModelState.IsValid) {
				<p>
					<ul class="message error no-margin">
						@Html.ValidationSummary()
					</ul>	
				</p>
			}
			
			<span class="number bigger">1</span>
			<small>Setup wizard</small>
			<h2 class="bigger">User</h2>

			<p class="required">
				<label for="simple-required">Username</label>
				@Html.TextBoxFor( x => x.Setup.Username, new { @class = "full-width", placeholder = "Write here the username" } )
			</p>

			<p class="required">
				<label for="simple-required">Password</label>
				@Html.PasswordFor(x => x.Setup.Password, new { @class = "full-width", placeholder = "Write here the password of the user" })
			</p>

			<p class="required">
				<label for="simple-required">Confirm Password</label>
				@Html.PasswordFor( x => x.Setup.ConfirmPassword, new { @class = "full-width", placeholder = "Write here the password of the user" } )
			</p>

			<p class="required">
				<label for="simple-required">Email</label>
				@Html.TextBoxFor(x => x.Setup.Email, new { @class = "full-width", placeholder = "info@mysite.com" })
			</p>

			<p class="required">
				<label for="simple-required">Confirm Email</label>
				@Html.TextBoxFor( x => x.Setup.ConfirmEmail, new { @class = "full-width", placeholder = "info@mysite.com" } )
			</p>

			<span class="number bigger">2</span>
			<small>Setup wizard</small>
			<h2 class="bigger">Settings</h2>

			<p class="required">
				<label for="name">Website name</label>
				@Html.TextBoxFor( x => x.Setup.WebSiteName, new { @class = "full-width", placeholder = "My Blog" } )
			</p>
			
			<p class="required">
				<label for="name">Site Domain</label>
				@Html.TextBoxFor( x => x.Setup.SiteDomain, new { @class = "full-width", placeholder = "mysite.com" } )
			</p>

			<p class="required">
				<label for="simple-required">Language</label>
				@Html.DropDownListFor( x => x.Setup.Language, Model.Languages.Select ( x => new SelectListItem { Text = x, Value = x, Selected = ( x == Model.Setup.Language ) } ), new { @class = "full-width" } )
			</p>

			<p class="required">
				<label for="simple-required">TimeZone</label>
				@Html.DropDownListFor( x => x.Setup.TimeZone, Model.TimesZone.Select ( x => new SelectListItem { Text = x.DisplayName, Value = x.Id, Selected = ( x.Id == Model.Setup.TimeZone ) } ), new { @class = "full-width" } )
			</p>

			<p class="required">
				<label for="simple-required">CultureInfo</label>
				@Html.DropDownListFor( x => x.Setup.CultureInfo, Model.CultureInfos.Select ( x => new SelectListItem { Text = x.DisplayName, Value = x.Name, Selected = ( x.Name == Model.Setup.CultureInfo ) } ), new { @class = "full-width" } )
			</p>

			<span class="number bigger">3</span>
			<small>Setup wizard</small>
			<h2 class="bigger">Database</h2>

			<p class="required">
				<label for="name">ConnectionString</label>
				@Html.TextBoxFor( x => x.Setup.ConnectionString, new { @class = "full-width", placeholder = "Data Source=MySqlServerName;Initial Catalog=MyDb;User Id=MyUsername;Password=MyPassword" } )
			</p>

			<p>
				@Html.CheckBoxFor( x => x.Setup.CreateDatabase, new { @class = "switch" } ) &nbsp;
				<label for="index" class="inline grey">Create database schema?.</label>
			</p>

			<p>
				<fieldset class="grey-bg collapsed">
					<legend><a href="#">Advanced Settings</a></legend>
					<p>
						<label for="simple-required">Table Prefix</label>
						@Html.TextBoxFor(x => x.Setup.DatabaseTablePrefix, new { @class = "full-width", placeholder = "Write the table prefix" })
					</p>

					<p>
						<label for="simple-required">Database Schema</label>
						@Html.TextBoxFor(x => x.Setup.DatabaseSchema, new { @class = "full-width", placeholder = "Write the database schema prefix" })
					</p>

					<p>
						<label for="simple-required">Database Type</label>
						@Html.DropDownListFor( x => x.Setup.DatabaseType, new SelectList ( Model.DataBaseTypes, "DatabaseValue", "DisplayName", Model.Setup.DatabaseType ) )
					</p>
				</fieldset>
			</p>
			
			<p style="text-align:right;">
				<button type="submit">Next</button>
				<button type="button" class="grey">Need help?</button>
			</p>
	</form>
	</div>
</section>

<!--[if lt IE 8]></div><![endif]-->
<!--[if lt IE 9]></div><![endif]-->
